﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;


namespace WindowsFormsApplication
{
    public partial class BLACK : Form
    {
        private Point mouseposition;
        private Boolean cursorHidden = false;

        public BLACK()
        {
            InitializeComponent();
            this.WindowState = FormWindowState.Maximized;
            this.FormBorderStyle = FormBorderStyle.None;
        }

        private void BLACK_DoubleClick(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Maximized)
            {
                this.WindowState = FormWindowState.Normal;
                this.MaximizeBox = false;
                this.Width = 100;
                this.Height = 100;
                this.Left = Cursor.Position.X-50;
                this.Top = Cursor.Position.Y-50;
            }
            else
            {
                this.WindowState = FormWindowState.Maximized;
                this.FormBorderStyle = FormBorderStyle.None;
            }
        }

        private void BLACK_MouseDown(object sender, MouseEventArgs e)
        {
            mouseposition = new Point(-e.X, -e.Y);

            if (e.Button == MouseButtons.Right)
            {
                switch (cursorHidden)
                {
                    case true:
                        Cursor.Show();
                        cursorHidden = false;
                        break;
                    case false:
                        Cursor.Hide();
                        cursorHidden = true;
                        break;
                    default:
                        Cursor.Show();
                        cursorHidden = false;
                        break;
                }
            }
        }

        private void BLACK_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Point mousePos = Cursor.Position;
                mousePos.Offset(mouseposition.X, mouseposition.Y);
                Location = mousePos;
            }
        }

        private void BLACK_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 27) //Esc
            {
                this.Close();
            }
        }
    }
}